import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysGroupRoleRelation = (params) => {
  params.head.transCode = 'querySysGroupRoleRelation';
  return request({
    url: '/platform/sysGroupRoleRelation/querySysGroupRoleRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysGroupRoleRelationListPage = (params) => {
  params.head.transCode = 'querySysGroupRoleRelationListPage';
  return request({
    url: '/platform/sysGroupRoleRelation/querySysGroupRoleRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysGroupRoleRelation = (params) => {
  params.head.transCode = 'saveSysGroupRoleRelation';
  return request({
    url: '/platform/sysGroupRoleRelation/saveSysGroupRoleRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysGroupRoleRelationList = (params) => {
  params.head.transCode = 'saveSysGroupRoleRelationList';
  return request({
    url: '/platform/sysGroupRoleRelation/saveSysGroupRoleRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysGroupRoleRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysGroupRoleRelation';
  return request({
    url: '/platform/sysGroupRoleRelation/saveOrUpdateSysGroupRoleRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysGroupRoleRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysGroupRoleRelationList';
  return request({
    url: '/platform/sysGroupRoleRelation/saveOrUpdateSysGroupRoleRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysGroupRoleRelation = (params) => {
  params.head.transCode = 'updateSysGroupRoleRelation';
  return request({
    url: '/platform/sysGroupRoleRelation/updateSysGroupRoleRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysGroupRoleRelation = (params) => {
  params.head.transCode = 'deleteSysGroupRoleRelation';
  return request({
    url: '/platform/sysGroupRoleRelation/deleteSysGroupRoleRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysGroupRoleRelationList = (params) => {
  params.head.transCode = 'deleteSysGroupRoleRelationList';
  return request({
    url: '/platform/sysGroupRoleRelation/deleteSysGroupRoleRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysGroupRoleRelationExcel = (params) => {
  downloadExcel({
    url: '/platform/sysGroupRoleRelation/excelDownload/exportSysGroupRoleRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
